﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;

public class BasePlayerModel:MoveAction,IResoule
{

    private string _playerName;//角色名
    private string _playerFamilyName;

    private SceneObject _playerObj;//角色场景对象


    public BasePlayerModel() { }

    public string playerName
    {
        get { return _playerName; }
        set { _playerName = value; }
    }

    public SceneObject playerObj
    {
        get { return _playerObj; }
        set
        {
            _playerObj = value;
            //....加载资源切换MoveAction中的_playerMovie,并实例化到舞台
            updataPlayerInfo(_playerObj);
        }
    }

    protected void updataPlayerInfo(SceneObject playerObj)
    {
        if (playerObj == null) return;

        vPosition = getPosPoint(playerObj);

        //WalkManager.getInstance().walkLogic.changeDept();//深度管理

        setPlayerName();
    }

    /// <summary>
    /// 设置玩家头顶的名字显示(缺标签，及定位)
    /// </summary>
    public void setPlayerName()
    {
        _playerName = SceneUtil.getName(_playerObj);
        _playerFamilyName = SceneUtil.getFamilyName(_playerObj);
    }

    /// <summary>
    /// 取玩家坐标
    /// </summary>
    protected Vector3 getPosPoint(SceneObject playerObj)
    {
        return new Vector3(0,0,0);
    }
    /// <summary>
    /// 设置显示/隐藏
    /// </summary>
    public void setVisible(Boolean visible)
    {
        //playerMovie.active = visible;
    }

    /// <summary>
    /// 复位一些需要初始化的变量或方法
    /// </summary>
    public void reset()
    {
    }

}